package java01.bll;

// 长方形-子类型继承了父类型(子类型与父类型签订了一份契约)
public class Retangle extends Shape {// 长方形也是一种(is-a)图形
    private double width;
    private double length;

    public Retangle(double width, double length) {
        this.width = width;
        this.length = length;
    }

    @Override
    public double getArea() {
        return width * length + offset;
    }

    @Override
    public double getPerimeter() {
        return (width + length) * 2 + offset;
    }
}
